using System.Collections;
using FlickrNet;

namespace FlickrShots.Framework.flickr
{
	public abstract class PhotoStream
	{
        private IList _photostream;
        protected readonly Connectr _connection = new Connectr();

		public PhotoStream()
		{
			_photostream = GetPhotoCollection();
		}

        public Photo this[int index]
        {
            get
            {
                return new Photo((FlickrNet.Photo)_photostream[index]);
            }
        }

	    public int Count
	    {
	        get { return _photostream.Count; }
	    }

		protected abstract PhotoCollection GetPhotoCollection();
	}

	public class UsersPhotoStream : PhotoStream
	{
		protected override PhotoCollection GetPhotoCollection()
		{
			return  _connection.GetCurrentUser().GetPhotoCollection();
		}
	}

	public class EveryonesPhotoStream : PhotoStream
	{
		protected override PhotoCollection GetPhotoCollection()
		{
			return _connection.Flickr.PhotosGetRecent().PhotoCollection;
		}
	}

	public class FriendsPhotoStream : PhotoStream 
	{
		protected override PhotoCollection GetPhotoCollection()
		{
			return _connection.GetCurrentUser().GetContactPhotoCollection();
		}
	}
}
